<script type="text/javascript">
	function chkAll(){
		if(document.getElementById("mTabsC1") != null && isDivBlock("mTabsC1") ){
			checkAllOptions('boxMovilesAlias[]', true);
		}
		if(document.getElementById("mTabsC2") != null && isDivBlock("mTabsC2") ){
			checkAllOptions('boxFlotasAlias[]', true);
		}
		if(document.getElementById("mTabsC3") != null && isDivBlock("mTabsC3") ){
			checkAllOptions('boxRCsAlias[]', true);
		}
		if(document.getElementById("mTabsC4") != null && isDivBlock("mTabsC4") ){
			checkAllOptions('boxRCsFijosAlias[]', true);
		}
		if(document.getElementById("mTabsC5") != null && isDivBlock("mTabsC5") ){
			checkAllOptions('boxFijosAlias[]', true);
		}
		if(document.getElementById("mTabsC6") != null && isDivBlock("mTabsC6") ){
			checkAllOptions('boxPermisosAlias[]', true);
		}
	}

	function unChkAll(){
		if(document.getElementById("mTabsC1") != null && isDivBlock("mTabsC1") ){
			checkAllOptions('boxMovilesAlias[]', false);
		}
		if(document.getElementById("mTabsC2") != null && isDivBlock("mTabsC2") ){
			checkAllOptions('boxFlotasAlias[]', false);
		}
		if(document.getElementById("mTabsC3") != null && isDivBlock("mTabsC3") ){
			checkAllOptions('boxRCsAlias[]', false);
		}
		if(document.getElementById("mTabsC4") != null && isDivBlock("mTabsC4") ){
			checkAllOptions('boxRCsFijosAlias[]', false);
		}
		if(document.getElementById("mTabsC5") != null && isDivBlock("mTabsC5") ){
			checkAllOptions('boxFijosAlias[]', false);
		}
		if(document.getElementById("mTabsC6") != null && isDivBlock("mTabsC6") ){
			checkAllOptions('boxPermisosAlias[]', false);
		}
	}
	ddtabmenu.definemenu("mTabs", 1);
	if(LOGIN.objetivoDB == 5 || LOGIN.objetivoDB == 3){
	}
</script>

<div id="errorSaveAlias" class="divErrorMsg roundedS" ></div>
<form action="">
  <div class="" style="width:625px;">
    <fieldset>
      <legend>Agregar Alias </legend>
      <div class="cerrar" onclick="cancelarAltaAlias(); return false;"></div>
      <ul class="form hhh">
        <li>
          <label>Alias:</label>
          <input type="text" id="misAliasAlias" />
          <input type="hidden" id="misAliasId" value=""/>
        </li>
        <label>Cambiar password</label>
        <input type="checkbox" id="aliasChangePass" value="true" title="Cambiar password" onchange="changeAliasPass();"/>
        <label style="text-align:right;">Habilitado</label>
        <input type="checkbox" id="aliasHabilitado" value="true" title="Habilitar" checked="checked"/>
        </li>
        <div class="clearfix"></div>
        <li>
          <label>Password:</label>
          <input type="password" id="misAliasClave" disabled="disabled" />
        </li>
        <li>
          <label>Repita Password:</label>
          <input type="password" id="misAliasReTypeClave" disabled="disabled" />
        </li>
        <div class="clearfix"></div>
        <li>
          <label>Nombre:</label>
          <input type="text" id="misAliasNombre" />
        </li>
        <li>
          <label>Email:</label>
          <input type="text" id="misAliasMail" />
        </li>
      </ul>
    </fieldset>
  </div>
</form>
<div id="mTabs" class="glowingtabs">
  <ul>
    <?php if( ($LOGIN->objetivoDB == 3) || ($LOGIN->objetivoDB == 5) ) { ?>
    <li><a rel="mTabsC1" ><span>Movil</span></a></li>
    <?php }
	if($LOGIN->objetivoDB == 5){ ?>
    <li><a rel="mTabsC2" ><span>Flotas</span></a></li>
    <li><a rel="mTabsC3" ><span>Empresas(Movil)</span></a></li>
    <li><a rel="mTabsC4" ><span>Empresas(Fijos)</span></a></li>
    <?php }?>
    <?php if($LOGIN->objetivoDB == 5 || $LOGIN->objetivoDB == 1){ ?>
    <li><a rel="mTabsC5" ><span>Fijos</span></a></li>
    <?php }?>
    <li><a rel="mTabsC6" ><span>Permisos</span></a></li>
  </ul>
</div>
<?php
if( ($LOGIN->objetivoDB == 3) || ($LOGIN->objetivoDB == 5) ) { ?>
<div class="tabcontainer2">
    <!-- tabcontent 1 -->
    <div id="mTabsC1" class="tabcontent" >
    <div class="clearfix"></div>
      <div id="movilesAlias" class="recuadro" ></div>
      <div class="clearfix"></div>
      <form action="" class="ajuste">
        <fieldset class="ajuste">
          <ul class="form">
            <li>
              <label>Ningun Movil</label>
              <input type='checkbox' name='chkNoMovil' id="chkNoMovil" value='1' >
            </li>
          </ul>
        </fieldset>
      </form>
    </div>

	<?php if($LOGIN->objetivoDB == 5){ ?>
    <!-- tabcontent 2 -->
    <div id="mTabsC2" class="tabcontent" >
    <div class="clearfix"></div>
      <div id="flotasAlias" class="recuadro" ></div>
      <div class="clearfix"></div>
      <form action="" class="ajuste">
        <fieldset class="ajuste">
          <ul class="form">
            <li>
              <label>Ninguna Flota</label>
              <input type='checkbox' name='chkNoFlota' id='chkNoFlota' value='1' >
            </li>
          </ul>
        </fieldset>
      </form>
    </div>

    <!-- tabcontent 3 -->
    <div id="mTabsC3" class="tabcontent" >
    <div class="clearfix"></div>
      <div id="rcAlias" class="recuadro" ></div>
      <div class="clearfix"></div>
      <form action="" class="ajuste">
        <fieldset class="ajuste">
          <ul class="form">
            <li>
              <label>Ninguna Empresa</label>
              <input type='checkbox' name='chkNoRC'  id='chkNoRC' value='1' >
            </li>
          </ul>
        </fieldset>
      </form>
    </div>

    <!-- tabcontent 4 -->
    <div id="mTabsC4" class="tabcontent">
    <div class="clearfix"></div>
      <div id="rcFijosAlias" class="recuadro" ></div>
      <div class="clearfix"></div>
      <form action="" class="ajuste">
        <fieldset class="ajuste">
          <ul class="form">
            <li>
              <label>Ninguna Empresa (fijos)</label>
              <input type='checkbox' name='chkNoRCFijo' id='chkNoRCFijo' value='1' >
            </li>
          </ul>
        </fieldset>
      </form>
    </div>

    <!-- tabcontent 5 -->
    <div id="mTabsC5" class="tabcontent">
    <div class="clearfix"></div>
      <div id="fijosAlias" class="recuadro" ></div>
      <div class="clearfix"></div>
      <form action="" class="ajuste">
        <fieldset class="ajuste">
          <ul class="form">
            <li>
              <label>Ningun Fijo</label>
              <input type='checkbox' name='chkNoFijo'  id='chkNoFijo' value='1' >
            </li>
          </ul>
        </fieldset>
      </form>
    </div>

	<?php } 
	} ?>
	
	<?php if($LOGIN->objetivoDB == 1){ ?>
	   <!-- tabcontent 5 -->
	    <div id="mTabsC5" class="tabcontent">
        <div class="clearfix"></div>
	      <div id="fijosAlias" class="recuadro" ></div>
	      <div class="clearfix"></div>
	      <form action="" class="ajuste">
	        <fieldset class="ajuste">
	          <ul class="form">
	            <li>
	              <label>Ningun Fijo</label>
	              <input type='checkbox' name='chkNoFijo'  id='chkNoFijo' value='1' >
	            </li>
	          </ul>
	        </fieldset>
	      </form>
	    </div>
	<?php }?>  
	
    <!-- tabcontent 6 -->
    <div id="mTabsC6" class="tabcontent">
    <div class="clearfix"></div>
      <div id="permisosAlias" class="recuadro" >
        <div class="clearfix"></div>
        <form action="">
            <fieldset>
              <legend>Configuraci&oacute;n de permisos:</legend>
              <ul class="form">
                <?php 
                foreach($LOGIN->PERMISOS as $key=>$i){ 
                	if($i) {
                        switch($key){
                            case 1: $label = "Monitoreo"; $iPermiso=0;break;
                            case 2: $label = "Envia Comandos GPRS";$iPermiso=1;break;
                            case 3: $label = "Envia Comandos SMS";$iPermiso=2;break;
                            case 4: $label = "Visualiza Puntos";$iPermiso=4;break;
                            case 5: $label = "Visualiza Zonas";$iPermiso=5;break;
                            case 6: $label = "Visualiza Logistica";$iPermiso=7;break;
                            case 7: $label = "Modifica Puntos";$iPermiso=8;break;
                            case 8: $label = "Modifica Zonas";$iPermiso=9;break;
                            case 9: $label = "Modifica Logistica";$iPermiso=11;break;
                            case 13: $label = "Accede a SETUP";$iPermiso=13;break;
                            case 14: $label = "Visualiza Contactos General";$iPermiso=27;break;
                            case 15: $label = "Modifica Contactos General";$iPermiso=28;break;
                            case 16: $label = "Visualiza Contacto de Movil";$iPermiso=6;break;
                            case 17: $label = "Modifica Contacto de Movil";$iPermiso=10;break;
                            case 20: $label = "Visualiza Rutas";$iPermiso=25;break;
                            case 21: $label = "Modifica Rutas";$iPermiso=26;break;
                            default : $label ="";break;
                        } 
                        if($label != ""){ ?>
		                <li>
		                  <label>
		                    <?=$label?>
		                  </label>
		                  <input type='checkbox' name='boxPermisosAlias[]' value='<?=$iPermiso?>' id='permiso_<?=$key?>'>
		                </li>
		            <?php } 
                	} 
                }?>
                <li>
                  <label>Visualiza Reportes</label>
                  <input type='checkbox' name='boxPermisosAlias[]' value='3' >
                </li>
                <li>
                  <label>Accede Movil</label>
                  <input type='checkbox' name='boxPermisosAlias[]' value='12' >
                </li>
                <?php if($LOGIN->objetivo==1 || $LOGIN->objetivo==2 || $LOGIN->objetivo==3){ ?>
                <li>
                  <label>Accede Eventos</label>
                  <input type='checkbox' name='boxPermisosAlias[]' value='14' >
                </li>
                <li>
                  <label>Accede Usuario</label>
                  <input type='checkbox' name='boxPermisosAlias[]' value='15' >
                </li>
                <li>
                  <label>Accede Facturas</label>
                  <input type='checkbox' name='boxPermisosAlias[]' value='16' >
                </li>
                <?php if($LOGIN->objetivo==1){ ?>
                <li>
                  <label>Accede Zonas</label>
                  <input type='checkbox' name='boxPermisosAlias[]' value='17' >
                </li>
                <?php } ?>
                <li>
                  <label>Accede Contactos</label>
                  <input type='checkbox' name='boxPermisosAlias[]' value='18' >
                </li>
                <?php if($LOGIN->objetivo==1){ ?>
                <li>
                  <label>Accede Horarios</label>
                  <input type='checkbox' name='boxPermisosAlias[]' value='19' >
                </li>
                <?php } } ?>
              </ul>
            </fieldset>
        </form>
      </div>

    
    </div>
      <div class="formContainer">
      <ul class="subMenubottom">
        <button type="button" id="btnGrabarAlias"  onclick="grabarAlias();" >
        	<img alt="" src="../images/icons/aceptar.png">Agregar
        </button>
        <button type="button" id="btnCancelarAlias" onclick="cancelarMisAlias();" ><img alt="" src="../images/icons/cancelar.png">Cancelar</button>
        <?php if( ($LOGIN->objetivoDB == 3) || ($LOGIN->objetivoDB == 5) || ($LOGIN->objetivoDB == 1) || ($LOGIN->objetivoDB == 2) ) { ?>
        <button type="button" id="btnMarcarAlias" onclick="chkAll();" ><img alt="" src="../images/icons/tildar.png">Marcar todos</button>
        <button type="button" id="btnDesmarcarAlias" onclick="unChkAll()" ><img alt="" src="../images/icons/destildar.png">Desmarcar todo</button>
        <?php } ?>
        <button type="button"  id="btnSalirAlias" onclick="cancelarAltaAlias(); return false;"><img alt="" src="../images/icons/salir.png">Salir</button>
      </ul>
    </div>
    
</div>